Skip to content

Add custom icon fonts to lvgl-module#499

Merged
KenVanHoeylandt merged 5 commits intomainfrom
lvgl-fonts-icons
Feb 13, 2026
Merged

Add custom icon fonts to lvgl-module#499
KenVanHoeylandt merged 5 commits intomainfrom
lvgl-fonts-icons

Conversation

@KenVanHoeylandt
Copy link
Contributor

@KenVanHoeylandt KenVanHoeylandt commented Feb 12, 2026

WIP

Summary by CodeRabbit

  • New Features

    • Added Material Design symbol fonts and LVGL font aliases for launcher, status bar, and shared UI icons.
  • Style

    • Migrated app icons across the UI to the new symbol font system.
    • Updated launcher button sizing, font styling, recoloring and icon text color for consistency.
    • Default text/icon font macros set for consistent sizing across the UI.
  • Documentation

    • Updated third‑party notices to include Material Design Icons links.

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

Adds a CMake macro for conditional module naming; adds a Python script to generate LVGL fonts and symbol headers; introduces three symbol header files (shared, statusbar, launcher) and three LVGL font source files (16px, 20px, 36px). Removes twelve TT_ASSETS app icon macros. Updates many app manifests and UI sources to use LVGL_SYMBOL_* constants, applies symbol font selection/styling, and adjusts launcher/app list icon handling.

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (32 files):

⚔️ Buildscripts/module.cmake (content)
⚔️ Devices/guition-jc3248w535c/guition,jc3248w535c.dts (content)
⚔️ Devices/guition-jc8048w550c/guition,jc8048w550c.dts (content)
⚔️ Documentation/ideas.md (content)
⚔️ Modules/lvgl-module/CMakeLists.txt (content)
⚔️ Modules/lvgl-module/Include/tactility/lvgl_module.h (content)
⚔️ THIRD-PARTY-NOTICES.md (content)
⚔️ Tactility/Include/Tactility/Assets.h (content)
⚔️ Tactility/Source/app/addgps/AddGps.cpp (content)
⚔️ Tactility/Source/app/apphub/AppHubApp.cpp (content)
⚔️ Tactility/Source/app/applist/AppList.cpp (content)
⚔️ Tactility/Source/app/appsettings/AppSettings.cpp (content)
⚔️ Tactility/Source/app/chat/ChatApp.cpp (content)
⚔️ Tactility/Source/app/development/Development.cpp (content)
⚔️ Tactility/Source/app/display/Display.cpp (content)
⚔️ Tactility/Source/app/files/FilesApp.cpp (content)
⚔️ Tactility/Source/app/fileselection/FileSelection.cpp (content)
⚔️ Tactility/Source/app/gpssettings/GpsSettings.cpp (content)
⚔️ Tactility/Source/app/i2cscanner/I2cScanner.cpp (content)
⚔️ Tactility/Source/app/keyboard/KeyboardSettings.cpp (content)
⚔️ Tactility/Source/app/launcher/Launcher.cpp (content)
⚔️ Tactility/Source/app/localesettings/LocaleSettings.cpp (content)
⚔️ Tactility/Source/app/notes/Notes.cpp (content)
⚔️ Tactility/Source/app/power/Power.cpp (content)
⚔️ Tactility/Source/app/screenshot/Screenshot.cpp (content)
⚔️ Tactility/Source/app/settings/Settings.cpp (content)
⚔️ Tactility/Source/app/systeminfo/SystemInfo.cpp (content)
⚔️ Tactility/Source/app/timedatesettings/TimeDateSettings.cpp (content)
⚔️ Tactility/Source/app/trackball/TrackballSettings.cpp (content)
⚔️ Tactility/Source/app/usbsettings/UsbSettings.cpp (content)
⚔️ Tactility/Source/app/webserversettings/WebServerSettings.cpp (content)
⚔️ Tactility/Source/app/wifimanage/WifiManage.cpp (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and concisely describes the main objective: adding custom icon fonts to the lvgl-module, which aligns with the extensive changes across multiple files for font and symbol support.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lvgl-fonts-icons
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch lvgl-fonts-icons
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
Modules/lvgl-module/Assets/generate-all.py (3)

35-35: Use idiomatic not in operator.

Ruff E713: not safe_name in codepoints should be safe_name not in codepoints.

Proposed fix
-        if not safe_name in codepoints:
+        if safe_name not in codepoints:

144-147: os.chdir is a global side-effect; prefer explicit path resolution.

Changing the process CWD makes the script fragile (e.g., if it's ever imported as a module, or if a future caller relies on CWD). It's safer to build absolute paths from base_dir throughout instead of mutating global state. That said, this does solve the relative-path resolution for the generate() and generate_icon_names() functions.

Suggested alternative
 base_dir = os.path.dirname(__file__)
-if base_dir:
-    os.chdir(base_dir)
+if not base_dir:
+    base_dir = "."

Then use os.path.join(base_dir, ...) in generate(), generate_icon_names(), download_file(), and when passing filenames.


65-142: Consider wrapping the top-level execution in if __name__ == "__main__":.

All code from line 63 onward (symbol lists, downloads, generation calls) runs unconditionally at import time. Adding a __main__ guard is standard Python practice and prevents side effects if this module is ever imported by another script (e.g., for testing or reuse of helper functions).


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Tactility/Source/app/i2cscanner/I2cScanner.cpp (1)

4-4: ⚠️ Potential issue | 🟡 Minor

Remove stale #include <Tactility/Assets.h> from line 4.

No TT_ASSETS_* symbols remain in this file after replacing TT_ASSETS_APP_ICON_I2C_SETTINGS with LVGL_SYMBOL_DEVICE_HUB. The include is no longer needed.

🧹 Nitpick comments (7)
Modules/lvgl-module/CMakeLists.txt (1)

26-26: Remove the -D prefix — target_compile_definitions adds it automatically.

CMake's target_compile_definitions will strip a leading -D, so this works, but it's non-idiomatic and may confuse readers. The quotes are also unnecessary here.

Suggested fix
-target_compile_definitions(${MODULE_NAME} PUBLIC "-DLV_LVGL_H_INCLUDE_SIMPLE")
+target_compile_definitions(${MODULE_NAME} PUBLIC LV_LVGL_H_INCLUDE_SIMPLE)
Modules/lvgl-module/Assets/generate-all.py (2)

1-1: Remove unnecessary semicolon.

Fix
-import os;
+import os

23-30: Use idiomatic not in operator.

Fix
-        if not safe_name in codepoints:
+        if safe_name not in codepoints:
Tactility/Source/app/systeminfo/SystemInfo.cpp (1)

5-5: Remove stale #include <Tactility/Assets.h>.

This include is no longer used. After replacing TT_ASSETS_APP_ICON_SYSTEM_INFO with LVGL_SYMBOL_MONITORING, there are no remaining references to any Assets.h symbols in this file.

Modules/lvgl-module/Include/tactility/lvgl_fonts.h (1)

13-13: Remove commented-out code or add context.

Line 13 has a commented-out macro with no explanation of why it's disabled or when it should be re-enabled. Consider removing it to reduce noise, or add a note explaining its purpose.

Modules/lvgl-module/Source/tactility/material_symbols_shared_16.c (1)

1-5: Generated file contains local filesystem path.

Line 4 embeds the full local path /home/ken/Projects/Tactility/... from the generation command. This is harmless but leaks developer environment details. Consider stripping the -o path from the opts comment, or documenting just the relevant generation parameters.

Modules/lvgl-module/Include/tactility/lvgl_symbols_shared.h (1)

1-34: Consider adding a header comment documenting the font source.

The symbol definitions look correct — the UTF-8 encodings match the codepoints in the material_symbols_shared_16 font. A brief comment at the top indicating these are Material Design Symbols (and which font resource renders them) would help future contributors understand the relationship.

Suggested addition
 `#pragma` once
 
+// Material Design Symbols - rendered by material_symbols_shared_16 font
+// See: https://fonts.google.com/icons
+
 `#define` LVGL_SYMBOL_MAIL "\xEE\x85\x99"

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Tactility/Source/app/launcher/Launcher.cpp (1)

62-64: ⚠️ Potential issue | 🟡 Minor

Stale comment: icon images are no longer 40×40.

Button sizes were changed to 36 and 56 (lines 22, 24), but this comment still says "40x40".

Proposed fix
-        // Ensure buttons are still tappable when the asset fails to load
-        // Icon images are 40x40, so we get some extra padding too
+        // Ensure buttons are still tappable when the symbol fails to render
         lv_obj_set_size(button_image, button_size, button_size);
🧹 Nitpick comments (2)
Tactility/Source/app/launcher/Launcher.cpp (1)

46-60: Text color and image recolor may be redundant for symbol-rendered icons.

Line 48 sets text_color to the theme primary, which is the correct way to color LVGL symbol text rendered via lv_image. The image_recolor block (lines 53–60) was meaningful for file-based images but is likely a no-op for symbol sources. Consider whether the recolor block can be removed now that icons are font-based, or add a brief comment explaining why both are kept (e.g., fallback for mixed usage).

Modules/lvgl-module/Assets/generate-all.py (1)

1-1: Minor style issues flagged by Ruff.

Line 1: trailing semicolon. Line 27: not in is the idiomatic Python membership test.

Proposed fix
-import os;
+import os
-        if not safe_name in codepoints:
+        if safe_name not in codepoints:

Also applies to: 27-27

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (5)
Tactility/Source/app/settings/Settings.cpp (1)

20-28: Duplicated widget-creation logic across three files.

This createWidget body is identical to createAppWidget in both AppSettings.cpp (line 21-27) and AppList.cpp (line 19-25). Consider extracting a shared helper (e.g., in an LVGL utility header) to avoid maintaining the same icon-fallback + font-setting logic in three places.

Modules/lvgl-module/Assets/generate-all.py (3)

1-1: Remove trailing semicolon.

-import os;
+import os

23-30: Use idiomatic not in operator.

Line 27: if not safe_name in codepoints should be if safe_name not in codepoints per Python style (PEP 8 / Ruff E713).

-        if not safe_name in codepoints:
+        if safe_name not in codepoints:

132-134: Consider making shared_symbol_font_sizes a plain list for consistency.

The other font groups pass inline lists ([20], [36]) to generate_icon_fonts. Having shared_symbol_font_sizes as a separate variable is fine, but the blank line between lines 131 and 132 visually detaches it from its symbol list. Minor readability nit.

Modules/lvgl-module/Include/tactility/lvgl_symbols_shared.h (1)

1-44: LGTM — symbol definitions are correct and complete.

All 42 macros correctly encode Material Symbol codepoints as 3-byte UTF-8 sequences in the Private Use Area (U+E000–U+F8FF), matching the 42 codepoints in the generated font file.

Minor nit: a few macros break the otherwise alphabetical ordering (DEPLOYED_CODE/DOWNLOAD after FOLDER on Lines 19–20, and NAVIGATION/KEYBOARD_ALT appended at the end on Lines 41–42). Consider sorting them for easier maintenance.

@KenVanHoeylandt KenVanHoeylandt merged commit 72c9b2b into main Feb 13, 2026
1 of 14 checks passed
@KenVanHoeylandt KenVanHoeylandt deleted the lvgl-fonts-icons branch February 13, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant